<%--
  Created by IntelliJ IDEA.
  User: zhangkeke
  Date: 2022/10/2
  Time: 08:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
  <title></title>

  <!--引入css-->
  <link rel="stylesheet" href="/css/bootstrap.css" >
  <!--引入js-->
  <script  src="/js/jquery-1.11.0.js"></script>
  <script  src="/js/bootstrap.js"></script>
  <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

</head>
<body>

<h2>学生信息管理</h2>
<div>

</div>

<table class="table table-bordered" >
  <tr>
    <td>学号</td>
    <td>姓名</td>
    <td>性别</td>
    <td>年龄</td>
    <td>地址</td>
    <td colspan="2">操作</td>
  </tr>
  <c:forEach var="student" items="${list.dataPage}">
    <tr>
      <td>${student.sid}</td>
      <td>${student.name}</td>
      <td>${student.sex}</td>
      <td>${student.age}</td>
      <td>${student.native_pl}</td>
      <td><a href="/select?sid=${student.sid}">修改</a></td>
      <td><a href="/delete?sid=${student.sid}">删除</a></td>
    </tr>
  </c:forEach>
  <tr>
      <td colspan="3"><a class="btn btn-default" href="/add.jsp" role="button" >添加</a></td>
    <%--<td colspan="3"><a href="/add.jsp">添加</a></td>--%>
  </tr>
</table>
<div style="position: fixed ;left:1000px;top:350px" >
    <%-- <a href="/findAll?currentPage=1&pageSize=5">首页</a>--%>
    <a class="btn btn-default" href="${pageContext.request.contextPath}/findAll?currentPage=1&pageSize=5" role="button">首页</a>
    <%-- <a href="${pageContext.request.contextPath}/findAll?currentPage=1&pageSize=5">首页</a>--%>
    <c:if test="${list.currentPage>1}">
        <a class="btn btn-default" href="${pageContext.request.contextPath}/findAll?currentPage=${list.currentPage-1}&pageSize=5" role="button">上一页</a>
        <%--<a href="${pageContext.request.contextPath}/findAll?currentPage=${list.currentPage-1}&pageSize=5">上一页</a>--%>
    </c:if>
    <%--
        下一页：
        要先判断当前页不是尾页
    --%>
    <c:if test="${list.currentPage<list.sumPage}">
        <a class="btn btn-default" href="${pageContext.request.contextPath}/findAll?currentPage=${list.currentPage+1}&pageSize=5" role="button">下一页</a>
        <%-- <a href="${pageContext.request.contextPath}/findAll?currentPage=${list.currentPage+1}&pageSize=5">下一页</a>--%>
    </c:if>
    <a class="btn btn-default" href="${pageContext.request.contextPath}/findAll?currentPage=${list.sumPage}&pageSize=5" role="button">尾页</a>
    <%--<a href="${pageContext.request.contextPath}/findAll?currentPage=${list.sumPage}&pageSize=5">尾页</a>--%>

</div>




</body>
</html>
